using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using NetWorkMsg;

namespace NetMsg.Music
{
    public struct GetMusicInfoQ : IServerCallbackable
    {
        
        public uint UnPackableId => 85;
        public uint PackableId => 111;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 111u);
        }
    }
    
    public class GetMusicInfoP : IUnPackable
    {
        // 解锁了的音乐列表
        public BitVector32 Unlocks;
        // 当前播放的音乐ID(0表示无效的,1开始)
        public int MusicId;
        
        public const uint Sid = 85;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out Unlocks);
            UnPackAuxiliary.Read(stream, out uint var0);
            MusicId = (int)var0;
        }
    }
    
    public struct PlayMusicQ : IIdPackable
    {
        public int MusicId;
        
        public uint PackableId => 112;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 112u);
            PackAuxiliary.Write(stream, (uint)MusicId);
        }
    }
    
    public struct StopMusicQ : IIdPackable
    {
        
        public uint PackableId => 113;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 113u);
        }
    }
    
    public class StartQ : IIdPackable
    {
        
        public uint PackableId => 114;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 114u);
        }
    }
    
    public class ReStartQ : IIdPackable
    {
        
        public uint PackableId => 115;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 115u);
        }
    }
    
    public struct PinballFoodReward : IPackable
    {
        public int FoodId;
        public int Number;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, (uint)FoodId);
            PackAuxiliary.Write(stream, (uint)Number);
        }
    }
    
    public struct GetRewardQ : IIdPackable
    {
        public int BossId;
        public int Gold;
        public List<PinballFoodReward> Foods;
        
        public uint PackableId => 116;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 116u);
            PackAuxiliary.Write(stream, (uint)BossId);
            PackAuxiliary.Write(stream, (uint)Gold);
            PackAuxiliary.Write(stream, (uint)Foods.Count);
            for(var i = 0; i < Foods.Count; ++i)
                PackAuxiliary.Write(stream, Foods[i]);
        }
    }
    
    public enum MusicEnum
    {
        GetMusicInfoP,
    }
}
